package com.example.factory;

/**
 * ClassName:testFactory
 * Package:com.example.factory
 * Description:
 *
 * @Author:ZhangXin
 * @Create:2023/5/8-20:37
 * @Version:v1.0
 */
public class testFactory {
    public static void main(String[] args) {
        //需要坦克
        Weapon tank = WeaponFactory.get("Tank");
        tank.attack();
        //需要战斗机
        Weapon fighter = WeaponFactory.get("Fighter");
        fighter.attack();
        //需要匕首
        Weapon dagger = WeaponFactory.get("Dagger");
        dagger.attack();
    }
}
